package com.genntii.examManager.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.genntii.examManager.common.result.PageResult;
import com.genntii.examManager.domain.entity.Subject;
import com.genntii.examManager.mapper.SubjectMapper;
import com.genntii.examManager.service.SubjectService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> implements SubjectService {

    @Resource
    private SubjectMapper subjectMapper;

    @Override
    public PageResult<Subject> getSubjectList(Integer pageNum, Integer pageSize) {
        return PageResult.build(subjectMapper.getSubjectList((pageNum-1)*pageSize,pageSize),
                subjectMapper.getSubjectTotal());
    }
}
